<?php
class Content_Form_MenuEditing extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');

        $menu = new Content_Model_Menu();

        $definition = $menu->getTable()->getColumnDefinition('title');
        $this->addElement('text', 'title', array(
            'label'      => 'Title',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('validator' => 'StringLength',
                      'options' => array(0, $definition['length']))
            )
        ));

        $this->addElement('textarea', 'body', array(
            'label'      => 'Body text',
            'required'   => true,
            'class'      => 'tinymce'
        ));

        $element = new Zend_Form_Element_Select('album_id');
        $element->setLabel('Album');
        $a = Content_Model_Album::getAlbumSelectData();
        $element->addMultiOptions($a);
        $element->getView()->setEscape('trim');
        $this->addElement($element);
     



        $this->addElement('checkbox', 'active', array(
            'label'      => 'Active',
        ));

        $this->addElement('submit', 'submit', array(
            'label'    => 'save',
        ));
    }
}
